home *** CD-ROM | disk | FTP | other *** search
/ 5 Star Games: DOS Edition 2 / 5 Star Games - DOS Edition (1995)(Ready to Run).iso / dbc / db_types.h < prev    next >
C/C++ Source or Header  |  1992-02-28  |  3KB  |  174 lines

  1. /****************************************************************************/
  2. /*            HEADER FILE OF COMMON TYPES USED BY DATABOSS MODULES          */
  3. /****************************************************************************/
  4.  
  5. /*********************************  TYPES  **********************************/
  6.  
  7. #ifdef __TURBOC__
  8.     #ifndef __COMPACT__
  9.         #ifndef __LARGE__
  10.             #ifndef __HUGE__
  11.                 #error Memory model chosen must use far pointers by default
  12.             #endif
  13.         #endif
  14.     #endif
  15. #else
  16.     #ifndef M_I86CM
  17.         #ifndef M_I86LM
  18.             #ifndef M_I86HM
  19.                 #error Memory model chosen must use far pointers by default
  20.             #endif
  21.         #endif
  22.     #endif
  23. #endif
  24.  
  25. /**********  CHAR TYPES  **********/
  26.  
  27. #define False  0
  28. #define True   1
  29.  
  30. typedef char         *charptr;
  31.  
  32. typedef unsigned char uchar;
  33. typedef uchar         string[256];
  34. typedef uchar        *strptr;
  35. typedef uchar         str8[9];
  36.  
  37. typedef unsigned char byte;
  38. typedef byte         *byteptr;
  39.  
  40. typedef unsigned char bool;
  41.  
  42. typedef byte          set[32];
  43.  
  44. /**********  INT TYPES  **********/
  45.  
  46. typedef int          *intptr;
  47.  
  48. typedef unsigned int  uint;
  49.  
  50. typedef unsigned int  word;
  51. typedef word         *wordptr;
  52.  
  53. typedef union {
  54.     word w;
  55.     int  i;
  56.     struct {
  57.         byte l;
  58.         byte h;
  59.     } b;
  60. } splitword;
  61.  
  62. /**********  LONG TYPES  **********/
  63.  
  64. typedef long         *longptr;
  65.  
  66. typedef unsigned long ulong;
  67.  
  68. typedef unsigned long lword;
  69. typedef lword        *lwordptr;
  70.  
  71. typedef union {
  72.     lword lw;
  73.     long l;
  74.     struct {
  75.         word l;
  76.         word h;
  77.     } w;
  78. } splitlong;
  79.  
  80. /**********  VOID TYPES  **********/
  81.  
  82. typedef void         *ptr;
  83.  
  84. typedef union {
  85.     struct {
  86.         word ofs;
  87.         word seg;
  88.     } w;
  89.     lword    lw;
  90.     charptr  cptr;
  91.     byteptr  bptr;
  92.     intptr   iptr;
  93.     wordptr  wptr;
  94.     longptr  lptr;
  95.     lwordptr lwptr;
  96.     ptr      ptr;
  97. } splitptr;
  98.  
  99. /**********  CHAR TYPES  **********/
  100.  
  101. #define FALSE  0
  102. #define TRUE   1
  103.  
  104. typedef char         *CHARPTR;
  105.  
  106. typedef unsigned char UCHAR;
  107. typedef uchar         STRING[256];
  108. typedef uchar        *STRPTR;
  109. typedef uchar         STR8[9];
  110.  
  111. typedef unsigned char BYTE;
  112. typedef byte         *BYTEPTR;
  113.  
  114. typedef unsigned char BOOL;
  115.  
  116. typedef byte          SET[32];
  117.  
  118. /**********  INT TYPES  **********/
  119.  
  120. typedef int          *INTPTR;
  121.  
  122. typedef unsigned int  UINT;
  123.  
  124. typedef unsigned int  WORD;
  125. typedef word         *WORDPTR;
  126.  
  127. typedef union {
  128.     word w;
  129.     int  i;
  130.     struct {
  131.         byte l;
  132.         byte h;
  133.     } b;
  134. } SPLITWORD;
  135.  
  136. /**********  LONG TYPES  **********/
  137.  
  138. typedef long         *LONGPTR;
  139.  
  140. typedef unsigned long ULONG;
  141.  
  142. typedef unsigned long LWORD;
  143. typedef lword        *LWORDPTR;
  144.  
  145. typedef union {
  146.     lword lw;
  147.     long l;
  148.     struct {
  149.         word l;
  150.         word h;
  151.     } w;
  152. } SPLITLONG;
  153.  
  154. /**********  VOID TYPES  **********/
  155.  
  156. typedef void        *PTR;
  157.  
  158. typedef union {
  159.     struct {
  160.         word ofs;
  161.         word seg;
  162.     } w;
  163.     lword    lw;
  164.     charptr  cptr;
  165.     byteptr  bptr;
  166.     intptr   iptr;
  167.     wordptr  wptr;
  168.     longptr  lptr;
  169.     lwordptr lwptr;
  170.     ptr      ptr;
  171. } SPLITPTR;
  172.  
  173. /***************************** END OF DB_TYPES.H ****************************/
  174.